package com.ymttest.database.sqlwapper;

import java.util.List;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.YmtOrderFrozen;

/************************************************************************************
 * @File name :DefaultWapper.java
 * @Author : zhouyi
 * @Date : 2015年6月1日
 * @Copyright : 洋码头
 ************************************************************************************/
public class YmtOrderFrozenWapper {
	static SqlManager manage;

	public YmtOrderFrozenWapper() {
		manage = new SqlManager("YmtRelease");
	}

	/**
	 * 使用 userloginid和applyuserloginid 查询信息
	 * 
	 * @param i
	 * @throws InterruptedException
	 */

	
	public List<YmtOrderFrozen> selectByTradingStatus(int iTradingStatus)
			throws InterruptedException {
		@SuppressWarnings("unchecked")
		List<YmtOrderFrozen> orderIdList = manage.getSelectResults(
				"com.ymttest.database.mapping.YmtOrderFrozenMapper.selectByTradingStatus",iTradingStatus);
        return orderIdList;

	}
	
	public List<Integer> selectOrderIdByTradingStatus(int iTradingStatus)
			throws InterruptedException {
		@SuppressWarnings("unchecked")
		List<Integer> orderIdList = manage.getSelectResults(
				"com.ymttest.database.mapping.YmtOrderFrozenMapper.selectOrderIdByTradingStatus",iTradingStatus);
        return orderIdList;
	}
	
	public List<YmtOrderFrozen> selectByBuyerId(int iBuyerId)
			throws InterruptedException {
		@SuppressWarnings("unchecked")
		List<YmtOrderFrozen> orderIdList = manage.getSelectResults(
				"com.ymttest.database.mapping.YmtOrderFrozenMapper.selectByBuyerId",iBuyerId);
        return orderIdList;

	}
	
	public List<YmtOrderFrozen> selectOrderFrozenByOrderId(int OrderId) 
			throws InterruptedException{
		@SuppressWarnings("unchecked")
		List<YmtOrderFrozen> list = manage
				.getSelectResults(
						"com.ymttest.database.mapping.YmtOrderFrozenMapper.selectOrderFrozenByOrderId",
						OrderId);
		return list;
	}
		
	/**
	 * 关闭数据库连接
	 */
	public void close() {
		manage.close();
	}

	@Override
	protected void finalize() throws Throwable {
		this.close();
		manage = null;
		super.finalize();
	}

	public static void main(String args[]) throws InterruptedException {
		List<Integer> orderlist= new YmtOrderFrozenWapper().selectOrderIdByTradingStatus(3);
		int a=1;
		int c=a;
	}
}